package com.steak.concurrent.CompletableFuture.api.call;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author 刘牌
 * @Title:
 * @date 2022-04-2312:07
 */
public class Call2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<Integer> acceptAsync = CompletableFuture.supplyAsync(() -> {
            return 100;
        }).whenComplete((s,th) -> {
            System.out.println(s);
        });
        System.out.println(acceptAsync.get());
    }
}
